package graphicsExtended.interactive;

import graphicsExtended.templates.abstractClass.Selectable;
import java.awt.event.MouseEvent;
/**
 *
 * @author Shimu
 */
public class OneButtonInteractiveAnimator extends MouseInteractiveAnimator {
    
    public OneButtonInteractiveAnimator(int screenWidth, int screenHeight,
            Selectable... objects) {
        super(screenWidth, screenHeight);
        addSelectables(objects);
    }

    @Override
    public void mouseClicked(MouseEvent e) {
        if (currentSelectable != Selectable.SENTINEL_SELECTABLE) {
            if (!e.isShiftDown()) {
                selectedObjects.clear();
            }
            selectedObjects.add(currentSelectable);
            currentSelectable.selected(mouseLocation);

        } else {
            // Notify all the selected objects of the left click
            for (Selectable s : selectedObjects) {
                s.mouseClicked(mouseLocation);
            }
        }
    }

    /* These methods do nothing */
    @Override
    public void mousePressed(MouseEvent e) {
    }

    @Override
    public void mouseReleased(MouseEvent e) {
    }

    @Override
    public void mouseEntered(MouseEvent e) {
    }

    @Override
    public void mouseExited(MouseEvent e) {
    }

    @Override
    public void mouseDragged(MouseEvent e) {
    }

}
